package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.Business;
import com.foreknow.elmboot.service.BusinessService;
import com.foreknow.elmboot.service.impl.BusinessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/BusinessController")
public class BusinessController {
    @Autowired
    private BusinessService businessService;
    @RequestMapping("/listBusinessByOrderTypeId")
    public Object listBusinessByOrderTypeId(Integer orderTypeId) {
        List<Business> list = businessService.getOrderByTypeId(orderTypeId);
        return list;
    }
    @RequestMapping("/getBusinessById")
    public Object getBusinessById(Integer businessId){
        Business business=businessService.getBusinessById(businessId);
        return business;
    }

}
